package com.example.administrator.myapplication;

import android.content.Context;
import android.content.SharedPreferences;

public class save {
    public static void   save(String val, Context context){
        SharedPreferences sp=context.getSharedPreferences("data.xml",Context.MODE_PRIVATE);
        SharedPreferences.Editor edit = sp.edit();
        edit.putString(val,val);
        edit.commit();
    }

    public static Boolean get(String val, Context context){
        SharedPreferences sp=context.getSharedPreferences("data.xml",Context.MODE_PRIVATE);
        String acc = sp.getString(val, null);
        if(acc==null){
            return false;
        }else {
            return true;
        }
    }
    public static void  cancle(Context context){
        SharedPreferences sp=context.getSharedPreferences("data.xml",Context.MODE_PRIVATE);
        SharedPreferences.Editor edit = sp.edit();
        edit.clear();
        edit.commit();
    }

}
